package com.itheima.order.controller;

import com.itheima.order.mapper.OrderDao;
import com.itheima.order.pojo.Order;
import com.itheima.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author ：xiaoZhou
 * @ClassName : OrderController
 * @date ：Created in 2021/12/14 22:47
 */
@Controller
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/getOrder/{id}")
    @ResponseBody
    public Order getOrder(@PathVariable("id") Long id){
       return orderService.findOrderById(id);
    }

}
